/*
 Navicat Premium Data Transfer

 Source Server         : db
 Source Server Type    : MySQL
 Source Server Version : 50622
 Source Host           : localhost
 Source Database       : shopping

 Target Server Type    : MySQL
 Target Server Version : 50622
 File Encoding         : utf-8

 Date: 02/14/2015 17:16:30 PM
*/

SET NAMES utf8;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
--  Table structure for `cart`
-- ----------------------------
DROP TABLE IF EXISTS `cart`;
CREATE TABLE `cart` (
  `id` bigint(20) NOT NULL,
  `finish` tinyint(1) DEFAULT NULL,
  `userid` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `userid` (`userid`),
  CONSTRAINT `userid` FOREIGN KEY (`userid`) REFERENCES `user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- ----------------------------
--  Records of `cart`
-- ----------------------------
BEGIN;
INSERT INTO `cart` VALUES ('1423838224485000000', '0', '10'), ('1423838224485000111', '1', '10'), ('1423840606217012312', '1', '11'), ('1423887797448000010', '1', '10');
COMMIT;

-- ----------------------------
--  Table structure for `goods`
-- ----------------------------
DROP TABLE IF EXISTS `goods`;
CREATE TABLE `goods` (
  `id` int(11) NOT NULL,
  `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `price` decimal(10,0) DEFAULT NULL,
  `type` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `relate` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `img_url` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- ----------------------------
--  Records of `goods`
-- ----------------------------
BEGIN;
INSERT INTO `goods` VALUES ('1', '棉花', '12', '生活用品', '酒精', 'static/img/flower.png'), ('2', '酒精', '22', '生活用品', '棉花', 'static/img/jiujing.png'), ('3', '雪梨', '222', '水果', '苹果', 'static/img/lizi.png'), ('4', '椅子', '112', '家具', '桌子', 'static/img/desk.png'), ('5', '桌子', '222', '家具', '椅子', 'static/img/chair.png'), ('6', '鞋子', '333', '服装', '衬衫', 'static/img/shoe.png'), ('7', '衬衫', '231', '服装', '鞋子', 'static/img/shirt.png'), ('8', 'iPhone6', '6222', '电子产品', 'ipad', 'static/img/iphone6.png'), ('9', 'ipad air', '2222', '电子产品', 'iphone6', 'static/img/ipad.png'), ('10', 'ipod', '1111', '电子产品', 'iPhone6', 'static/img/iphone6.png'), ('11', 'mac', '8888', '电子产品', 'ipad', 'static/img/ipad.png'), ('12', '香蕉', '11', '水果', '苹果', 'static/img/lizi.png'), ('13', '西瓜', '11', '水果', '香蕉', 'static/img/lizi.png'), ('14', '纸巾', '1112', '生活用品', '棉花', 'static/img/jiujing.png'), ('15', '被子', '32', '生活用品', '桌子', 'static/img/jiujing.png'), ('16', '扫把', '22', '家具', '椅子', 'static/img/desk.png'), ('17', '毛衣', '44', '服装', '衬衫', 'static/img/shirt.png'), ('18', '键盘', '55', '电子产品', 'mac', 'static/img/shirt.png'), ('19', '灯', '21', '家具', '椅子', 'static/img/desk.png'), ('20', '衣架', '22', '家具', '灯', 'static/img/desk.png'), ('21', '书', '11', '文化', '笔', 'static/img/desk.png'), ('23', 's570', '33', '电子产品', '23', 'static/img/shirt.png'), ('24', '草稿纸', '11', '文化', '本子', 'static/img/desk.png'), ('25', '钥匙', '22', '安全', '锁', 'static/img/desk.png'), ('26', '锁', '22', '安全', '钥匙', 'static/img/desk.png'), ('27', '床', '222', '生活用品', '被子', 'static/img/desk.png'), ('28', '枕头套', '111', '生活用品', '枕头', 'static/img/desk.png'), ('29', '枕头', '234', '生活用品', '枕头套', 'static/img/desk.png'), ('30', 's3', '3200', '电子产品', 's4', 'static/img/desk.png'), ('31', 's4', '3500', '电子产品', 's3', 'static/img/desk.png'), ('32', 's6', '23', '电子产品', '23', 'static/img/desk.png');
COMMIT;

-- ----------------------------
--  Table structure for `order`
-- ----------------------------
DROP TABLE IF EXISTS `order`;
CREATE TABLE `order` (
  `id` bigint(11) NOT NULL,
  `goods_id` int(11) DEFAULT NULL,
  `cart_id` bigint(11) DEFAULT NULL,
  `count` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `cart` (`cart_id`) USING BTREE,
  KEY `good` (`goods_id`),
  CONSTRAINT `cart` FOREIGN KEY (`cart_id`) REFERENCES `cart` (`id`),
  CONSTRAINT `good` FOREIGN KEY (`goods_id`) REFERENCES `goods` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- ----------------------------
--  Records of `order`
-- ----------------------------
BEGIN;
INSERT INTO `order` VALUES ('1111111111', '12', '1423838224485000111', '1'), ('11111113311', '1', '1423838224485000000', '1'), ('1111111111111', '1', '1423838224485000111', '1'), ('11111211111111', '1', '1423838224485000111', '1'), ('1423904505154000003', '1', '1423838224485000000', '1'), ('1423905190077000003', '3', '1423838224485000000', '1'), ('1423905207501000006', '6', '1423838224485000000', '1');
COMMIT;

-- ----------------------------
--  Table structure for `user`
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
  `id` int(11) NOT NULL,
  `nickname` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `address` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `password` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- ----------------------------
--  Records of `user`
-- ----------------------------
BEGIN;
INSERT INTO `user` VALUES ('10', 'jack', '广州', 'a'), ('11', 'tony', '深圳', 'a'), ('13', 'sunny', '兰州', 'a'), ('100', '11', '福州', 'a');
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
